import { pubRequire } from '@utils/public'
const baseUrl = '/activities/flowers'
const baseUrlTwo = '/communities/shelves'
/** 参与用户接口 */

// 根据活动id查询活动期次
export function getStages(id, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}/stages`, '', callbBack, errBack)
}
/*获取参与用户列表*/
export function getPartakeList(id,params, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}/users`, params, callbBack, errBack)
}

// 查询已上架的商品列表
export function getgoodsList(params, callbBack, errBack) {
  return pubRequire('get', `${baseUrlTwo}`, params, callbBack, errBack)
}

// 参与用户添加奖励
export function addUserAwards(id,params, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}/${id}/users/awards`, params, callbBack, errBack)
}

// 参与用户列表导出
export function partakeExport(params) {
  return `${baseUrl}/${params.id}/users/export`
}

/** 奖励记录 */

// 获取奖励记录列表
export function getRecordsList(id, params, callbBack, errBack) {
return pubRequire('get', `${baseUrl}/${id}/awards-records`, params, callbBack, errBack)
}

// 奖励记录列表导出
export function recordsExport(params) {
  return `${baseUrl}/${params.id}/awards-records/export`
}

// 编辑鲜花活动排序
export function sortActive(id, obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}/sort`, obj, callbBack, errBack)
}
// 结束开启鲜花活动
export function endActive(obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${obj.id}/end`, obj, callbBack, errBack)
}
// 删除鲜花活动
export function delActive(obj, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${obj.id}`, obj, callbBack, errBack)
}

// 立即开启鲜花活动
export function startActive(obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${obj.id}/start`, obj, callbBack, errBack)
}